[fb_arr,pb_arr,snips,fb_pert_num,pb_pert_num]=meta_receptive_field_map(proj_meta,[2 4]);
[fb_arr_ff,pb_arr_ff,vis_arr,run_arr,ffm_arr]=fig3a(proj_meta,[1 2 3 4 5]);

sequence=[1 2 3 8 9 10 4 5 6 11 12 13];
for tnd=1:3
    figure;
    set(gcf,'pos',[520   430   895   368])
    for pnd=1:13
        if pnd<13
            subplot(2,7,sequence(pnd))
            rectangle('position',[11 0.97 10 1.15],'facecolor',[0.9 0.9 0.9],'linestyle','none')
            hold on
            cur_fb=mean(fb_arr(575:end,:,tnd,pnd),1);
            cur_fb=cur_fb+diff([cur_fb(11) 1]);
            cur_pb=mean(pb_arr(575:end,:,tnd,pnd),1);
            cur_pb=cur_pb+diff([cur_pb(11) 1]);
            plot(cur_fb,'k','linewidth',2)
            plot(cur_pb,'g','linewidth',2)
            ylim([0.98 1.11])
        else
            subplot(2,7,7)
            rectangle('position',[11 0.97 10 1.15],'facecolor',[0.9 0.9 0.9],'linestyle','none')
            hold on
            cur_fb=mean(fb_arr_ff(575:end,:,tnd),1);
            cur_fb=cur_fb+diff([cur_fb(11) 1]);
            cur_pb=mean(pb_arr_ff(575:end,:,tnd),1);
            cur_pb=cur_pb+diff([cur_pb(11) 1]);
            plot(cur_fb,'k','linewidth',2)
            plot(cur_pb,'g','linewidth',2)
            ylim([0.98 1.11])
        end
    end
end

sequence=[1 2 3 8 9 10 4 5 6 11 12 13];
figure;
for pnd=1:13
    if pnd<13
        subplot(2,7,sequence(pnd))
        rectangle('position',[11 0.98 10 1.12],'facecolor',[0.9 0.9 0.9],'linestyle','none')
        hold on
        cur_pb=mean(pb_arr(:,:,1,pnd),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 0.4 0])
        cur_pb=mean(pb_arr(:,:,2,pnd),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 0.7 0])
        cur_pb=mean(pb_arr(:,:,3,pnd),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 1 0])
        ylim([0.98 1.1])
    else
        subplot(2,7,7)
        rectangle('position',[11 0.98 10 1.12],'facecolor',[0.9 0.9 0.9],'linestyle','none')
        hold on
        cur_pb=mean(pb_arr_ff(:,:,1),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 0.4 0])
        cur_pb=mean(pb_arr_ff(:,:,2),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 0.7 0])
        cur_pb=mean(pb_arr_ff(:,:,3),1);
        cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
        plot(cur_pb,'color',[0 1 0])
        ylim([0.98 1.1])
    end
end

sequence=[1 2 3 8 9 10 4 5 6 11 12 13];
figure;
for pnd=1:13
    if pnd<13
        subplot(2,7,sequence(pnd))
        rectangle('position',[11 0.98 10 1.125],'facecolor',[0.9 0.9 0.9],'linestyle','none')
        hold on
        for tnd=1:7
            cur_pb=mean(pb_arr(1:574,:,tnd,pnd),1);
            cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
            plot(cur_pb,'color',[0 0 0]+((0.9/7)*tnd))
        end
        ylim([0.98 1.125])
    else
        subplot(2,7,7)
        rectangle('position',[11 0.98 10 1.125],'facecolor',[0.9 0.9 0.9],'linestyle','none')
        hold on
        for tnd=1:7
            cur_pb=mean(pb_arr_ff(1:574,:,tnd),1);
            cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
            plot(cur_pb,'color',[0 0 0]+((0.9/7)*tnd))
        end
        ylim([0.98 1.125])
    end
end
% cur_pb=pb_arr(:,:,4,2);
% cur_pb=cur_pb(cur_pb(:,1)~=0,:);
% plot(mean(cur_pb,1),'color',[0 0.4 0])

figure;
rectangle('position',[11 0.985 10 0.04],'facecolor',[0.9 0.9 0.9],'linestyle','none')
hold on
cur_pb=mean(pb_arr_ff(:,:,1),1);
cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
plot(cur_pb,'color',[0 0.6 0])
cur_pb=mean(pb_arr_ff(:,:,2),1);
cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
plot(cur_pb,'color',[0 0.8 0])
cur_pb=mean(pb_arr_ff(:,:,3),1);
cur_pb=cur_pb+diff([mean(cur_pb(6:10)) 1]);
plot(cur_pb,'color',[0 1 0])

figure;
rectangle('position',[5 0.985 10 0.07],'facecolor',[0.9 0.9 0.9],'linestyle','none')
hold on
for tnd=1:7
    cur_pb=mean(pb_arr_ff(1:574,:,tnd),1);
    cur_pb=cur_pb+diff([mean(cur_pb(8:11)) 1]);
    plot(cur_pb(6:end),'color',[0 0 0]+((0.9/7)*tnd))
end
